package com.gui.lock.web;

import com.gui.common.Result;
import com.gui.entity.Person;
import com.gui.lock.service.LockService;
import com.gui.lock.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static org.springframework.web.bind.annotation.RequestMethod.POST;

@RestController
@RequestMapping("/lock")
public class LockController {

    @Autowired
    private LockService lockService;

    @RequestMapping(value = "/setnx", method = POST)
    public Result<String> setnx() {
        return Result.success(lockService.setnx());
    }

    @RequestMapping(value = "/redisson", method = POST)
    public Result<String> redisson() {
        return Result.success(lockService.redisson());
    }
}
